package work20241202_chap5oop.g_oop;


/**
 * @author zdl
 * @date 2024/12/2
 */
public class Demo9 {
    public static void main(String[] args) {
        Address a = new Address("北京市海淀区","100084");
        System.out.println(a.address);
        System.out.println(a.zipCode);
        Worker w = new Worker("zhangsan",25,2500,a);
        System.out.println(w.name);
        System.out.println(w.age);
        System.out.println(w.salary);
        System.out.println(w.addr.address);
        System.out.println(w.addr.zipCode);
    }
}

class Worker{
    String name;
    int age;
    double salary;

    Address addr;
    public Worker(){}
    public Worker(String name,int age,double salary,Address addr){
        this.age = age;
        this.name = name;
        this.salary = salary;
        this.addr = addr;
    }
    public void work(){

    }
    public void work (int hours){

    }
}
